<template >
  <div>
    <ChargingUsers  Query="Query"/>
    <roll height="550px">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="序号" width="108px"></el-table-column>
        <el-table-column prop="date" label="用户昵称"></el-table-column>
        <el-table-column prop="code" label="手机号"></el-table-column>
        <el-table-column prop="date" label="车辆类型"></el-table-column>
        <el-table-column label="是否可用">
          <template slot-scope="scope">
            <div v-if="scope.row.is" class="available">
                可用
            </div>
            <div v-if="!scope.row.is" class="NoAvailable">
                不可用
            </div>
          </template>  
        </el-table-column>    
        <el-table-column prop="date" label="注册时间"></el-table-column>
      </el-table>
    </roll>
       <div class="block">
      <el-pagination
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-size="pageSize"
        layout="total,  prev, pager, next, jumper"
        :total="20"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
import ChargingUsers from "./ChargingUsers";
import roll from "@/components/Roll";
export default {
  components: {
    ChargingUsers,
    roll
  },
  data() {
    return {
      tableData: [
        {
          date: "2016-05-01",
          code: "1589518635483",
          is:true
        }, {
          date: "2016-05-02",
          code: "1589518635483",
          is:true

        },
        {
          date: "2016-05-04",
          code: "1589518635483",
          is:false

        },
        {
          date: "2016-05-01",
          code: "1589518635483",
          is:false
        }
      ],  
      currentPage: 1, //当前第几页
      pageSize: 10
    };
  },
  methods:{
      handleSizeChange(e) {
      this.$emit("SizeChange", e);
    },
    handleCurrentChange(e) {
      this.$emit("CurrentChange", e);
    },
      Query(e){


      }
  }
};
</script>
<style scoped>
.block {
    text-align: center;
}
.available:before{
  content: ' ';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #09daba;
  border-radius: 50%;
}
.NoAvailable:before{
  content: ' ';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: red;
  border-radius: 50%;
}
</style>